import http from "./http"


const postNotice = (data) => {
    const path = "/notice/"
    return http.post(path, data)
}


const getNotice = (page = 1, size = 10, params) => {
    const path = "/notice/all"
    params = params ? params : {}
    params['page'] = page
    params['size'] = size
    return http.get(path, params)
}

const updateNotice = (pk, data) => {
    const path = "/notice/" + pk
    return http.put(path, data)
}

const deleteNotice = (pk) => {
    const path = "/notice/" + pk
    return http.delete(path)
}

const publishNotice = (pk) => {
    const path = "/notice/publish/" + pk
    return http.post(path)
}


export default {postNotice, getNotice, updateNotice, deleteNotice, publishNotice}